package main

import "fmt"

/**
 * @Description
 * @Author huran
 * @Date
 * @Param
 * @return
 **/
type MyWriter interface {
	Write(string) error
}
type MyCloser interface {
	Close() error
}
type writerCloser struct {
	MyWriter
}

type fileWriter struct {
	filePath string
}

func (fw *fileWriter) Write(a string) error {
	fmt.Println("文件写入", a)
	return nil
}

type databaseWriter struct {
	Host     string
	Password string
}

func (dw *databaseWriter) Write(string) error {
	fmt.Println("数据库写入")
	return nil
}

func main() {
	closer := writerCloser{&databaseWriter{}}
	fmt.Println(closer.Write("sdfs"))
}
